home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / C Internet Config / IC Component Source ƒ / IC Headers ƒ / IC API Descriptions.h < prev    next >
Encoding:
Text File  |  1995-11-17  |  21.4 KB  |  189 lines  |  [TEXT/SPM ]

  1. */
  2.  
  3. ICError ICSetPref(ICInstance inst,StringPtr key,ICAttr attr,Ptr buf,long size);
  4. /*
  5.     You must specify a configuration before calling this routine.
  6.     If you are getting or setting multiple preferences, you should place
  7.     these calls within an ICBegin/ICEnd pair.
  8.     If you call this routine outside of such a pair, it implicitly
  9.     calls ICBegin(inst, icReadWritePerm).
  10.     Sets the preference specified by key from the IC database to the
  11.     value pointed to by buf and size.
  12.     key must not be the empty string.
  13.     size must be non-negative. 
  14.     If buf is nil then the preference value is not set and size is ignored.
  15.     If buf is not nil then the preference value is set to the size
  16.     bytes pointed to by buf.
  17.     If attr is ICattr_no_change then the preference attributes are not set.
  18.     Otherwise the preference attributes are set to attr.
  19.     Returns icPermErr if the previous ICBegin was passed icReadOnlyPerm.
  20.     Returns icPermErr if current attr is locked, new attr is locked and buf <> nil.
  21. */
  22.  
  23. ICError ICFindPrefHandle(ICInstance inst,StringPtr key,ICAttr* attr,Handle prefh);
  24. /*
  25.     Requires IC 1.2.
  26.     You must specify a configuration before calling this routine.
  27.     If you are getting or setting multiple preferences, you should place
  28.     these calls within an ICBegin/ICEnd pair.
  29.     If you call this routine outside of such a pair, it implicitly
  30.     calls ICBegin(inst, icReadWritePerm).
  31.     This routine effectively replaces ICGetPrefHandle.
  32.     Reads the preference specified by key from the IC database into
  33.     a handle, prefh.
  34.     key must not be the empty string.
  35.     attr is set to the attributes associated with the preference.
  36.     You must set prefh to a non-nil handle before calling this routine.
  37.     If the preference does not exist, icPrefNotFoundErr is returned.
  38. */
  39.  
  40. ICError ICGetPrefHandle(ICInstance inst,StringPtr key,ICAttr* attr,Handle* prefh);
  41. /*
  42.     Requires IC 1.1.
  43.     You must specify a configuration before calling this routine.
  44.     If you are getting or setting multiple preferences, you should place
  45.     these calls within an ICBegin/ICEnd pair.
  46.     If you call this routine outside of such a pair, it implicitly
  47.     calls ICBegin(inst, icReadOnlyPerm).
  48.     This routine is now obsolete. Use ICFindPrefHandle instead.
  49.     Reads the preference specified by key from the IC database into
  50.     a newly created handle, prefh.
  51.     key must not be the empty string.
  52.     attr is set to the attributes associated with the preference.
  53.     The incoming value of prefh is ignored.
  54.     A new handle is created in the current heap and returned in prefh.
  55.     If the routine returns an error, prefh is set to nil.
  56.     If the preference does not exist, no error is returned and prefh is set
  57.     to an empty handle.
  58. */
  59.  
  60. ICError ICSetPrefHandle(ICInstance inst,StringPtr key,ICAttr attr,Handle prefh);
  61. /*
  62.     Requires IC 1.1.
  63.     You must specify a configuration before calling this routine.
  64.     If you are getting or setting multiple preferences, you should place
  65.     these calls within an ICBegin/ICEnd pair.
  66.     If you call this routine outside of such a pair, it implicitly
  67.     calls ICBegin(inst, icReadWritePerm).
  68.     Sets the preference specified by key from the IC database to the
  69.     value contained in prefh.
  70.     key must not be the empty string.
  71.     If prefh is nil then the preference value is not set.
  72.     If buf is not nil then the preference value is set to the data
  73.     contained in it.
  74.     If attr is ICattr_no_change then the preference attributes are not set.
  75.     Otherwise the preference attributes are set to attr.
  76.     Returns icPermErr if the previous ICBegin was passed icReadOnlyPerm.
  77.     Returns icPermErr if current attr is locked, new attr is locked and prefh <> nil.
  78. */
  79.  
  80. ICError ICCountPref(ICInstance inst,long* count);
  81. /*
  82.     You must specify a configuration before calling this routine.
  83.     You must be inside an ICBegin/End pair to call this routine.
  84.     Counts the total number of preferences.
  85.     If the routine returns an error, count is set to 0.
  86. */
  87.  
  88. ICError ICGetIndPref(ICInstance inst,long n,StringPtr key);
  89. /*
  90.     You must specify a configuration before calling this routine.
  91.     You must be inside an ICBegin/End pair to call this routine.
  92.     Returns the key of the Nth preference.
  93.     n must be positive.
  94.     Returns ilename(ICInstance inst,StringPtr filename,ICMapEntry* entry);
  95. /*
  96.     Requires IC 1.1.
  97.     You must specify a configuration before calling this routine.
  98.     If you are getting or setting multiple preferences, you should place
  99.     these calls within an ICBegin/ICEnd pair.
  100.     If you call this routine outside of such a pair, it implicitly
  101.     calls ICBegin(inst, icReadWritePerm).
  102.     Takes the name of an incoming file and returns the most appropriate
  103.     mappings database entry, based on its extension.
  104.     filename must not be the empty string.
  105.     Returns icPrefNotFoundErr if no suitable entry is found.
  106. */
  107.  
  108. ICError ICMapTypeCreator(ICInstance inst,OSType fType,OSType fCreator,StringPtr filename,ICMapEntry* entry);
  109. /*
  110.     Requires IC 1.1.
  111.     You must specify a configuration before calling this routine.
  112.     You must be inside an ICBegin/End pair to call this routine.
  113.     Takes the type and creator (and optionally the name) of an outgoing
  114.     file and returns the most appropriate mappings database entry.
  115.     The filename may be either the name of the outgoing file or
  116.     the empty string.
  117.     Returns icPrefNotFoundErr if no suitable entry found.
  118. */
  119.  
  120. /* ----- Mid Level Routines ----- */
  121.  
  122. ICError ICMapEntriesFilename(ICInstance inst,Handle entries,StringPtr filename,ICMapEntry* entry);
  123. /*
  124.     Requires IC 1.1.
  125.     You must specify a configuration before calling this routine.
  126.     You do not have to be inside an ICBegin/End pair to call this routine.
  127.     Takes the name of an incoming file and returns the most appropriate
  128.     mappings database entry, based on its extension.
  129.     entries must be a handle to a valid IC mappings database preference.
  130.     filename must not be the empty string.
  131.     Returns icPrefNotFoundErr if no suitable entry is found.
  132. */
  133.  
  134. ICError ICMapEntriesTypeCreator(ICInstance inst,Handle entries,OSType fType,OSType fCreator,StringPtr filename,ICMapEntry* entry);
  135. /*
  136.     Requires IC 1.1.
  137.     You must specify a configuration before calling this routine.
  138.     You do not have to be inside an ICBegin/End pair to call this routine.
  139.     Takes the type and creator (and optionally the name) of an outgoing
  140.     file and returns the most appropriate mappings database entry.
  141.     entries must be a handle to a valid IC mappings database preference.
  142.     The filename may be either the name of the outgoing file or
  143.     the empty string.
  144.     Returns icPrefNotFoundErr if no suitable entry found.
  145. */
  146.  
  147. /* ----- Low Level Routines ----- */
  148.  
  149. ICError ICCountMapEntries(ICInstance inst,Handle entries,long* count);
  150. /*
  151.     Requires IC 1.1.
  152.     You must specify a configuration before calling this routine.
  153.     You do not have to be inside an ICBegin/End pair to call this routine.
  154.     Counts the number of entries in the mappings database.
  155.     entries must be a handle to a valid IC mappings database preference.
  156.     count is set to the number of entries.
  157. */
  158.  
  159. ICError ICGetIndMapEntry(ICInstance inst,Handle entries,long ndx,long* pos,ICMapEntry* entry);
  160. /*
  161.     Requires IC 1.1.
  162.     You must specify a configuration before calling this routine.
  163.     You do not have to be inside an ICBegin/End pair to call this routine.
  164.     Gets the ndx'th entry in the mappings database.
  165.     entries must be a handle to a valid IC mappings database preference.
  166.     ndx must be in the range from 1 to the number of entries in the database.
  167.     The value of pos is ignored on input. pos is set to the position of
  168.     the ndx'th entry in the database and is suitable for passing back
  169.     into ICSetMapEntry.
  170.     Does not return any user data associated with the entry.
  171. */
  172.  
  173. ICError ICGetMapEntry(ICInstance inst,Handle entries,long pos,ICMapEntry* entry);
  174. /*
  175.     Requires IC 1.1.
  176.     You must specify a configuration before calling this routine.
  177.     You do not have to be inside an ICBegin/End pair to call this routine.
  178.     Returns the entry located at position pos in the mappings database.
  179.     entries must be a handle to a valid IC mappings database preference.
  180.     pos should be 0 to get the first entry. To get the subsequent entries, add
  181.     entry.total_size to pos and iterate.
  182.     Does not return any user data associated with the entry.
  183. */
  184.  
  185. ICError ICSetMapEntry(ICInstance inst,Handle entries,long pos,ICMapEntry* entry);
  186. /*
  187.     Requires IC 1.1.
  188.     You must specify